<?php
namespace My\Model;

use Utuo\UtuoModel;

class ProductActivityModel extends UtuoModel {
	
	protected $_validate = array(
		array('product_goods_id', 'require', '请先选择商品', self::MUST_VALIDATE),
	);
	
	protected $_auto = array(
		array('ext_info', 'getExtInfo', self::MODEL_BOTH, "callback"),
		array('start_time', 'strtotime', self::MODEL_BOTH, "function"),
		array('end_time', 'strtotime', self::MODEL_BOTH, "function"),
	);
	
	protected function getExtInfo() {
		$extInfo = $_REQUEST['ext_info'];
		if( empty($_REQUEST['ext_info']) or !is_array($_REQUEST['ext_info'])) return false;
		return serialize($extInfo);
	}
	
}